package de.fuberlin.inf.alp3.ue06;

public class Multiplication extends BinaryOp {

    Multiplication(Expression left, Expression right) {
        super(left, right);
    }

    @Override
    public Expression eval() {
        try {
            return new Integer(((Integer) left.eval()).getValue() * ((Integer) right.eval()).getValue());
        } catch (ClassCastException e) {
            throw new RuntimeException("Operands of Multiplication must be integers");
        }
    }
}
